// 云对象教程: https://uniapp.dcloud.net.cn/uniCloud/cloud-obj
// jsdoc语法提示教程：https://ask.dcloud.net.cn/docs/#//ask.dcloud.net.cn/article/129
module.exports = {
	_before: function () { // 通用预处理器

	},
	async getConfig() {
		let dbJQL = uniCloud.databaseForJQL({clientInfo: this.getClientInfo()});
		return await dbJQL.collection('xxm-system-config').orderBy("_id desc").limit(1).get({getOne: true});
	},
	async updateConfig(params = {}) {
		let dbJQL = uniCloud.databaseForJQL({clientInfo: this.getClientInfo()});
		params.updateTime = Date.now();
		return await dbJQL.collection('xxm-system-config').update(params);
	}
}
